<template>
  <el-table :data="list" class="comment-list"
            style="width: 100%;padding-top: 15px;height: 450px;overflow: auto">
    <el-table-column label="最新评论">
      <template slot-scope="scope">
        <div style="display: flex">
          <el-avatar :src="scope.row.avatar" style="flex-shrink: 0"></el-avatar>
          <div class="content" style="margin-left: 10px">
            <div style="display: flex;justify-content: space-between;width: 100%">
              <div class="nkname">
                <span class="name">{{ scope.row.nickname }} </span>
                <span class="date">{{ scope.row.createTime | dateFormat3 }}</span>
              </div>
            </div>
            <p class="reply">{{ scope.row.content }}</p>
          </div>
        </div>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import { reqCommentList } from '../../../api/adminApi'

export default {

  data() {
    return {
      editing: false,
      list: [],
      title: '最新评论'
    }
  },
  created() {
    this.getCommentList()
  },
  methods: {
    getCommentList() {
      reqCommentList({ pageNum: 1, pageSize: 10 }).then(data => {
        this.list = data.list
      })
    },
  }
}
</script>
